# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=heaptrack
pkgver=1.4.0
pkgrel=3
arch=(loong64 x86_64)
pkgdesc='A heap memory profiler for Linux'
url='http://milianw.de/tag/heaptrack'
license=(GPL)
depends=(kdiagram threadweaver kio boost-libs hicolor-icon-theme)
makedepends=(extra-cmake-modules boost sparsehash kitemmodels)
source=(https://download.kde.org/stable/$pkgname/$pkgver/$pkgname-$pkgver.tar.xz{,.sig}
        $pkgname-boost-1.81.0-include.patch::https://github.com/KDE/heaptrack/commit/de3174aa1d12.patch)
sha256sums=('fc6b3226c36ca7faef58c9268dce427a83558ee48a2b636044ca084453a01f6d'
            'SKIP'
            '99e2d30c44545d74af538c9be9d483c40d520c252c9eb65d80ff61a19a9304b7')
validpgpkeys=(3D8568869097C65C98F8D2760C0EB212CD1D1393
              C51B45A532F17FA401D099A0A0C6B72C4F1C5E7C) # Milian Wolff <mail@milianw.de>

prepare() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../$pkgname-boost-1.81.0-include.patch
}

build() {
  cmake -B build -S $pkgname-$pkgver \
   -DCMAKE_INSTALL_PREFIX=/usr \
   -DBUILD_TESTING=OFF
  cmake --build build
}

package(){
  DESTDIR="$pkgdir" cmake --install build
}
